<template>
	<view>
		<myMeal :data="mealData" v-if="mealData.price"></myMeal>
		<view class="bottom" v-else @click="toMember">
			购买套餐
		</view>
	</view>
</template>

<script>
	import myMeal from '@/pagesA/components/myMeal/myMeal.vue'
	import {
		orderGet,
	} from '@/api/package/package.js'
	export default {
		components: {
			myMeal
		},
		data() {
			return {
				mealData: {}
			}
		},
		onShow() {
			let that = this
			uni.showLoading({
				title: "加载中",
				mask: true
			})
			orderGet().then(res2 => {
				uni.hideLoading()
				if (res2.code == 0) {
					// console.log('套餐订单',res2)
					if (res2.data) {
						that.mealData = res2.data
					}
				}
			})
		},
		methods: {
			toMember() {
				this.$tab.navigateTo('/pagesA/meal/meal')
			}
		}
	}
</script>

<style>
.bottom {
    width: 690rpx;
    height: 100rpx;
    text-align: center;
    line-height: 100rpx;
    font-size: 35rpx;
    background: #E84E22;
    border-radius: 48rpx;
    color: #FFFFFF;
    position: fixed;
    bottom: 60rpx;
    left: 30rpx;
	}
</style>